mydata <- data.frame(data1=rnorm(10),
                     data2=rnorm(10),
                     data3=rnorm(10))
lapply(mydata,sum)
sapply(mydata,sum)

A <- matrix(1:9,nrow=3)
B <- matrix(1:16,nrow=4)
C <- matrix(1:8,nrow=4)
mylist <- list(A=A,B=B,C=C)
lapply(mylist,'[',,2)
